<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body style="background-color: #887FB3">

<?php
require('config.php');

if(!isset($_COOKIE['islogin']) || $_COOKIE['islogin']!=1){
echo "<script>window.navigate('login.php');</script>";
}
if(isset($_GET['action'])){
    $vsID = $_GET['action'];
    $result_update = mysql_query("update vote_subject set state='进行中' where vsID=$vsID") or die(mysql_error());
    if($result_update>0){
        echo "<script type='text/javascript'>alert('投票启动成功！开始投票吧！');window.navigate('manager-vote.php');</script>";
    }
}
//if(isset($_POST['delete_vote'])){
//    $viID = $_POST['viid'];
//    $result_del = mysql_query("delete from vote_subject,vote_item where vsID=$vsID") or die(mysql_erroe());
//    if($result_update>0){
//        $arr['success']=1;
//        echo json_encode($arr);
//    }
//}

?>

</body>
</html>